﻿using System.Collections.Generic;
using System.Linq;
using NHibernate;
using NHibernate.Linq;
using Hasiu.Entity;

namespace Hasiu.Service
{
    public class NewsTypeService
    {
        public static readonly NewsTypeService _ = new NewsTypeService();

        private ISession Session { get; set; }

        public NewsTypeService()
        {
            Session = NHibernateHelper.GetCurrentSession();
        }

        public NewsType Get(string id)
        {
            return Session.Get<NewsType>(id);
        }

        public IList<NewsType> GetList()
        {
            return Session.Query<NewsType>().ToList();
        }
    }
}
